const http = uni.$u.http

//wx_jdk
export const get_jssdk = (params, config = {}) => http.post('/xcx/login', params, config)
//获取短信
export const send_message = (data) => http.get('/note/send', data)
//登录注册
export const login = (params, config = {}) => http.post('/wx/login', params, config)
//微信配置信息
export const getConfig = (data,config = {}) => http.get('/wx/getConfig',data,config)
//会员详情
export const getMemberInfo = (data,config = {}) => http.get('/index/getMemberInfo',data,config)
//邀请用户
export const basicInfo = (params, config = {}) => http.post('/user/basicInfo', params, config)
//获取自己邀请信息
export const getBasicInfo = (data) => http.get('/user/getBasicInfo',data)
//用户信息接口  
export const getUserInfo = (config = {}) => http.get('/user/getUserInfo',config)
//收藏用户
export const addCollect = (params, config = {}) => http.post('/user/addCollect', params, config)
//取消收藏用户
export const delCollect = (params, config = {}) => http.post('/user/delCollect', params, config)
// 我的收藏列表
export const getCollect = (data) => http.get('/user/getCollect',data)
//查询是否收藏用户
export const isCollect = (config = {}) => http.get('/user/isCollect',config)
//解锁用户照片
export const addUnlock = (params, config = {}) => http.post('/user/addUnlock', params, config)

//会员列表
export const getMemberList = (config = {}) => http.get('/index/getMemberList',config)
//省市区
export const getAddress = (config = {}) => http.get('/index/getAddress',config)
//审核列表
export const getUserAuditList = (data) => http.get('/match/getUserAuditList',data)
//红娘id 列表
export const getMatchList = (config = {}) => http.get('/match/getMatchList',config)
//获取指定用户邀请信息
export const getUserBasicInfo = (data, config = {}) => http.get('/match/getUserBasicInfo',data,config)
//修改指定用户的邀请信息
export const editBasicInfo = (params, config = {}) => http.post('/match/editBasicInfo', params, config)
//发布公告
export const sendMessage = (params, config = {}) => http.post('/match/sendMessage', params, config)
//公告信息
export const getMessage = (config = {}) => http.get('/index/getMessage',config)

//发布广告
export const saveAdvert = (params, config = {}) => http.post('/match/saveAdvert', params, config)
//广告信息
export const getAdvert = (config = {}) => http.get('/index/getAdvert',config)
//上墙列表
export const getWallList = (data) => http.get('/index/getWallList',data)
//广场列表
export const getSinglesSquare = (data) => http.get('/index/getSinglesSquare',data)
//用户主页 
export const getUserDetaileInfo = (data) => http.get('/index/getUserInfo',data)
//发布活动
export const addActivity = (params, config = {}) => http.post('/match/addActivity', params, config)
//询问列表
export const getInquiryList = (data) => http.get('/match/getInquiryList',data)
//
export const returnVisit = (data) => http.get('/match/returnVisit',data)

//询问信息详细
export const mutualDetails = (data) => http.get('/user/mutualDetails',data)
//推送列表
export const pushList = (data) => http.get('/match/pushList',data)
//我的会员
export const getUserList = (data) => http.get('/match/getUserList',data)
//设置已询问
export const asked = (params, config = {}) => http.post('/match/asked', params, config)
//设置询问结果
export const askResults = (params, config = {}) => http.post('/match/askResults', params, config)
//
export const setMember = (params, config = {}) => http.post('/match/setMember', params, config)
//活动列表
export const getActivityList = (data) => http.get('/user/getActivityList',data)
//更改状态
export const setStatus = (params, config = {}) => http.post('/match/setStatus', params, config)
//活动详细
export const getActivityOne = (data) => http.get('/user/getActivityOne',data)
//删除活动
export const delActivity = (params, config = {}) => http.post('/match/delActivity', params, config)
//修改活动
export const editActivity = (params, config = {}) => http.post('/match/editActivity', params, config)
//保存案例
export const saveCase = (params, config = {}) => http.post('/match/saveCase', params, config)
//案例列表
export const getCaseList = (data) => http.get('/user/getCaseList',data)
//删除案例
export const delCase = (params, config = {}) => http.post('/match/delCase', params, config)
//询问用户
export const addInquiry = (params, config = {}) => http.post('/user/addInquiry', params, config)
//设置询问状态
export const setInquiryStatus = (params, config = {}) => http.post('/match/setInquiryStatus', params, config)
//红娘主动推荐
export const setApply = (params, config = {}) => http.post('/match/setApply', params, config)
//解锁key
export const getKey = (config = {}) => http.get('/match/getKey',config)
//推荐列表
export const getRecommendUserList = (data) => http.get('/match/getRecommendUserList',data)
//查询指定用户解锁列表
export const getUnlockUserList = (data) => http.get('/match/getUnlockUserList',data)
//查询指定用户询问列表
export const getInquiryUserList = (data) => http.get('/match/getInquiryUserList',data)
//查询指定被人询问列表
export const getBeInquiryUserList = (data) => http.get('/match/getBeInquiryUserList',data)
//代理列表
export const getDeputyBasicList = (data) => http.get('/match/getDeputyBasicList',data)
//删除代理
export const delDeputy = (params, config = {}) => http.post('/match/delDeputy', params, config)
//填写邀请代理
export const deputyBasicInfo = (params, config = {}) => http.post('/user/deputyBasicInfo', params, config)
//代理详细
export const getDeputyBasicInfo = (data) => http.get('/match/getDeputyBasicInfo',data)
//恋爱列表
export const loveList = (data) => http.get('/match/loveList',data)
//申请人红娘/被询问人红娘设置费用
export const setCost = (params, config = {}) => http.post('/match/setCost',params, config)
//询问次数表
export const getInquiryOutside = (data) => http.get('/match/getInquiryOutside',data)
//会员新增报表
export const getUserAddList = (data) => http.get('/match/getUserAddList',data)
//会员恋爱，分手了，幸福统计表
export const getUserLoveList = (data) => http.get('/match/getUserLoveList',data)
//红娘编辑代理
export const editDeputyBasicInfo = (params, config = {}) => http.post('/match/editDeputyBasicInfo',params, config)
//设置代理状态
export const setDeputyStatus = (params, config = {}) => http.post('/match/setDeputyStatus',params, config)
//解锁key 邀请会员key
 export const getInviteCode =  (params, config = {}) => http.post('/match/getInviteCode',params, config)
//邀请key详细信息
 export const getInviteCodeKeyInfo =  (data) => http.get('/user/getInviteCodeKeyInfo',data)
//查询是否解锁和照片信息
 export const isIntegralUnlock =  (data) => http.get('/user/isIntegralUnlock',data)
//查询指定用户给Ta推荐列表
 export const getGiveRecommendUserList =  (data) => http.get('/match/getGiveRecommendUserList',data)
//询问是福需要积分
export const isIntegralInquiry =  (data) => http.get('/user/isIntegralInquiry',data)
// 设置用户积分
 export const setIntegral =  (params, config = {}) => http.post('/match/setIntegral',params, config)
// 查看用户积分明细
export const getIntegralDetail =  (data) => http.get('/match/getIntegralDetail',data)
//签到
export const sign =  (params, config = {}) => http.post('/user/sign',params, config)
//签到列表
export const getSign =  (data) => http.get('/user/getSign',data)
//今天是否已签到
export const getTodaySign =  (data) => http.get('/user/getTodaySign',data)
//用户查看自己的积分明细
export const user_getIntegralDetail =  (data) => http.get('/user/getIntegralDetail',data)
//查询自己足迹询问列表
export const user_getInquiryUserList =  (data) => http.get('/user/getInquiryUserList',data)
//查询自己的足迹解锁列表接口
export const user_getUnlockUserList =  (data) => http.get('/user/getUnlockUserList',data)
//查询自己的足迹绑定过列表
export const getBindingList =  (data) => http.get('/user/getBindingList',data)
//设置用户是否主动推荐
export const setIsRecommend =  (params, config = {}) => http.post('/match/setIsRecommend',params, config)
//我的推荐列表
export const getUserRecommendList =  (data) => http.get('/user/getUserRecommendList',data)
//自动推荐
export const inappropriate =  (params, config = {}) => http.post('/user/inappropriate',params, config)
//牵线搭桥列表搜索
export const getIdsUserList = (data) => http.get('/match/getIdsUserList',data)
//牵线搭桥
export const arrangeAMeeting =  (params, config = {}) => http.post('/match/arrangeAMeeting',params, config)

//微信支付
export const wexinPay = (data, cb, errorCb, cancels) => {
	let [appId, timestamp, nonceStr, signature, packages, paySign] = [data.appId, data.timeStamp, data.nonceStr, data.signature,
		data.package, data.paySign
	];
	uni.requestPayment({
		provider: 'wxpay',
		// #ifdef MP-WEIXIN
		timeStamp:timestamp, // 时间戳从1970年1月1日至今的秒数，即当前的时间
		nonceStr: nonceStr, // 随机字符串，长度为32个字符以下
		package: packages, // 统一下单接口返回的 prepay_id 参数值，提交格式如：prepay_id=xx
		signType: 'MD5', //签名算法，暂支持 MD5
		paySign:paySign, // 签名
		// #endif
		success: function(r) {
			// 支付成功的回调中 创建绘本馆成功
			cb(r);
		},
		fail: function(err) {
			console.log(err)
			errorCb(err);
				
		},
		cancel(err) {
			// 用户取消支付
			cancels(err)
		},
	});
}


